<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
    <title>日新网</title>
    <link rel="stylesheet" href="__TMPL__Public/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="__TMPL__Public/assets/css/reset.css">
    <link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
    <script type="text/javascript" src="__TMPL__Public/assets/js/rem.js"></script>
    <style>
        /*专栏认证 导航样式？*/
        .column_introduce_page .row1 span {
            color: #000232;
        }

        .column_introduce_page {
            border-bottom: 2px solid #afafbd;
        }

        .column_introduce_page .row1 {
            padding-top: .12rem;
            padding-bottom: .12rem;
            margin-top: .28rem;
            background: url("./images/lt.png") left center no-repeat;
            background-size: .18rem .18rem;

        }

        .text textarea, input {
            background-color: #f9f9f9 !important;

        }

        .text p {
            font-weight: bolder;
            margin-bottom: .15rem;
        }

        .timer input {
            width: 49%;
            display: inline-block;

        }

        .item_delete {

            text-align: center;
            margin-top: .5rem;
            letter-spacing: 1px;
        }

        .item_delete a {
            color: #000232;
        }

    </style>
</head>
<body>
<!--nav-->
<tc_include file="Public:nav"/>

<!--专栏认证头部开始-->
<div class="comWidth column_introduce_page">
    <div class="container ">
        <div class="row row1">
            <div class="col-xs-6">
                <a href="{:U('professor/professor/professor_edit')}"><span>&nbsp;< 返回</span></a>
            </div>
            <div class="col-xs-6 text-right">
                <a class="add_mod_pf_col" href="javascript:;"><span>保存</span></a>
            </div>
        </div>
    </div>
</div>
<div style="height: .5rem;"></div>
<div class="comWidth">
    <form method="post" action="{:U('professor/professor/pf_education_edit')}">
        <input type="hidden" name="id" value="{$pf_education.id}">
        <div class="form-group">
            <label for="school">学校名称:</label>
            <input type="text" class="form-control" id="school" name="school" value="{$pf_education.school}" placeholder="学校名称">
        </div>
        <div class="form-group">
            <label for="major">专业:</label>
            <input type="text" class="form-control" id="major" name="major" value="{$pf_education.major}" placeholder="专业">
        </div>
        <div class="form-group">
            <label for="degree">学位:</label>
            <input type="text" class="form-control" id="degree" name="degree" value="{$pf_education.degree}" placeholder="学位">
        </div>
        <div class="form-group">
            <label for="">起止时间</label>
            <p></p>
            <p class="timer clearfix">
                <input type="date" class="form-control pull-left" id="start_time" name="start_time" value="{$pf_education.start_time}">
                <input type="date" class="form-control pull-right" id="end_time" name="end_time" value="{$pf_education.end_time}">
            </p>

        </div>
        <div class="text">
            <p>经历描述</p>
            <textarea class="form-control" rows="10" name="experience" placeholder="参加过的社团|活动|比赛、爱好特长、作品文件...">{$pf_education.experience}</textarea>
        </div>

        <if condition="!empty($pf_education['id'])">
            <p class="item_delete">
                <a class="del_pf_col" data-id="{$pf_education.id}" data-href="{:U('professor/professor/pf_education_edit')}">删除此项</a>
            </p>
        </if>
    </form>

</div>
<!--页脚-->
<tc_include file="Public:footer"/>
<script type="text/javascript" src="__TMPL__Public/assets/js/jquery.1.12.4.js"></script>
<script src="__TMPL__Public/assets/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/layer/layer_1.js"></script>
<script>
    $(document).ready(function () {

        // 删除
        $('.del_pf_col').click(function () {
            var url = $(this).attr('data-href');
            var id  = $(this).attr('data-id');
            layer.confirm("确认删除？", {
                btn: ['确定', '取消']
            }, function () {
                $.post(url, {id : id, delete : 1}, function (re) {
                    layer.msg(re.info);
                    if (re.status) {
                        setTimeout(function () {
                            window.location.href = "{:U('professor/professor/professor_edit')}";
                        }, 2000);
                    }
                })
            });
        });

        // 修改 or 添加
        $('.add_mod_pf_col').click(function () {
            $('form').submit();
        })
    })
</script>
</body>
</html>